package com.nit.server.controller;


import com.nit.server.common.Result;
import com.nit.server.entity.Menu;
import com.nit.server.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zb
 * @since 2023-7-16
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/list")
    public Result list(@RequestParam String roleId){
       List list = menuService.lambdaQuery().like(Menu::getMenuRight,roleId).list();

        return list.size()>0?Result.success(list):Result.fail();
    }


}
